<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionView::LookupContext::DetailsCache</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Module</span> 
            ActionView::LookupContext::DetailsCache 
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_view/lookup_context_rb.html">actionpack/lib/action_view/lookup_context.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>Add caching behavior on top of Details.</p>

    </div>
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>#</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="DetailsCache.html#method-i-_set_detail">_set_detail</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>D</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="DetailsCache.html#method-i-disable_cache">disable_cache</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [RW]
            </td>
            <td class='attr-name'>cache</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-disable_cache">
            
              <b>disable_cache</b>()
            
            <a href="DetailsCache.html#method-i-disable_cache" name="method-i-disable_cache" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Temporary skip passing the details_key forward.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-disable_cache_source')" id="l_method-i-disable_cache_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/7950c0f1f883b8a0c81859b92dfcb21bf4589096/actionpack/lib/action_view/lookup_context.rb#L88" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-disable_cache_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/lookup_context.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">disable_cache</span>
  <span class="ruby-identifier">old_value</span>, <span class="ruby-ivar">@cache</span> = <span class="ruby-ivar">@cache</span>, <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@cache</span> = <span class="ruby-identifier">old_value</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
              
      <div class="sectiontitle">Instance Protected methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-_set_detail">
            
              <b>_set_detail</b>(key, value)
            
            <a href="DetailsCache.html#method-i-_set_detail" name="method-i-_set_detail" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-_set_detail_source')" id="l_method-i-_set_detail_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/7950c0f1f883b8a0c81859b92dfcb21bf4589096/actionpack/lib/action_view/lookup_context.rb#L97" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-_set_detail_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/lookup_context.rb, line 97</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">_set_detail</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@details</span> = <span class="ruby-ivar">@details</span>.<span class="ruby-identifier">dup</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@details_key</span>
  <span class="ruby-ivar">@details_key</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@details</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    